
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>（三）其他 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../单元测试.html" />
    
    
    <link rel="prev" href="日志规约.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    一、编程规约
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../编程规约/命名风格.html">
            
                <a href="../编程规约/命名风格.html">
            
                    
                    （一）命名风格
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../编程规约/常量定义.html">
            
                <a href="../编程规约/常量定义.html">
            
                    
                    （二）常量定义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../编程规约/代码格式.html">
            
                <a href="../编程规约/代码格式.html">
            
                    
                    （三）代码格式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../编程规约/OOP规范.html">
            
                <a href="../编程规约/OOP规范.html">
            
                    
                    （四）OOP规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../编程规约/集合处理.html">
            
                <a href="../编程规约/集合处理.html">
            
                    
                    （五）集合处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../编程规约/并发处理.html">
            
                <a href="../编程规约/并发处理.html">
            
                    
                    （六）并发处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="../编程规约/控制语句.html">
            
                <a href="../编程规约/控制语句.html">
            
                    
                    （七）控制语句
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="../编程规约/注释规约.html">
            
                <a href="../编程规约/注释规约.html">
            
                    
                    （八）注释规约
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    二、异常日志
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="异常处理.html">
            
                <a href="异常处理.html">
            
                    
                    （一）异常处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="日志规约.html">
            
                <a href="日志规约.html">
            
                    
                    （二）日志规范
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3.3" data-path="其他.html">
            
                <a href="其他.html">
            
                    
                    （三）其他
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../单元测试.html">
            
                <a href="../单元测试.html">
            
                    
                    三、单元测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../安全规约.html">
            
                <a href="../安全规约.html">
            
                    
                    四、安全规约
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    五、MySQL数据库
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../MySQL数据库/建表规约.html">
            
                <a href="../MySQL数据库/建表规约.html">
            
                    
                    （一）建表规约
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../MySQL数据库/索引规约.html">
            
                <a href="../MySQL数据库/索引规约.html">
            
                    
                    （二）索引规约
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../MySQL数据库/SQL语句.html">
            
                <a href="../MySQL数据库/SQL语句.html">
            
                    
                    （三）SQL语句
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../MySQL数据库/ORM映射.html">
            
                <a href="../MySQL数据库/ORM映射.html">
            
                    
                    （四）ORM映射
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" >
            
                <span>
            
                    
                    六、工程结构
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../工程结构/应用分层.html">
            
                <a href="../工程结构/应用分层.html">
            
                    
                    （一）应用分层
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../工程结构/二方库依赖.html">
            
                <a href="../工程结构/二方库依赖.html">
            
                    
                    （二）二方库依赖
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../工程结构/服务器.html">
            
                <a href="../工程结构/服务器.html">
            
                    
                    （三）服务器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../版本历史.html">
            
                <a href="../版本历史.html">
            
                    
                    附1：版本历史 
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../本手册专有名词.html">
            
                <a href="../本手册专有名词.html">
            
                    
                    附2：本手册专有名词 
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >（三）其他</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x4E09;-&#x5176;&#x5B83;">(&#x4E09;) &#x5176;&#x5B83;</h2>
<ol>
<li>&#x3010;&#x5F3A;&#x5236;&#x3011;&#x5728;&#x4F7F;&#x7528;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x65F6;&#xFF0C;&#x5229;&#x7528;&#x597D;&#x5176;&#x9884;&#x7F16;&#x8BD1;&#x529F;&#x80FD;&#xFF0C;&#x53EF;&#x4EE5;&#x6709;&#x6548;&#x52A0;&#x5FEB;&#x6B63;&#x5219;&#x5339;&#x914D;&#x901F;&#x5EA6;&#x3002; 
<br><span style="color:orange">&#x8BF4;&#x660E;</span>&#xFF1A;&#x4E0D;&#x8981;&#x5728;&#x65B9;&#x6CD5;&#x4F53;&#x5185;&#x5B9A;&#x4E49;&#xFF1A;Pattern pattern = Pattern.compile(&#x89C4;&#x5219;); </li>
<li>&#x3010;&#x5F3A;&#x5236;&#x3011;velocity&#x8C03;&#x7528;POJO&#x7C7B;&#x7684;&#x5C5E;&#x6027;&#x65F6;&#xFF0C;&#x5EFA;&#x8BAE;&#x76F4;&#x63A5;&#x4F7F;&#x7528;&#x5C5E;&#x6027;&#x540D;&#x53D6;&#x503C;&#x5373;&#x53EF;&#xFF0C;&#x6A21;&#x677F;&#x5F15;&#x64CE;&#x4F1A;&#x81EA;&#x52A8;&#x6309;&#x89C4;&#x8303;&#x8C03;&#x7528;POJO&#x7684;getXxx()&#xFF0C;&#x5982;&#x679C;&#x662F;boolean&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x53D8;&#x91CF;&#xFF08;boolean&#x547D;&#x540D;&#x4E0D;&#x9700;&#x8981;&#x52A0;is&#x524D;&#x7F00;&#xFF09;&#xFF0C;&#x4F1A;&#x81EA;&#x52A8;&#x8C03;&#x7528;isXxx()&#x65B9;&#x6CD5;&#x3002; <br><span style="color:orange">&#x8BF4;&#x660E;</span>&#xFF1A;&#x6CE8;&#x610F;&#x5982;&#x679C;&#x662F;Boolean&#x5305;&#x88C5;&#x7C7B;&#x5BF9;&#x8C61;&#xFF0C;&#x4F18;&#x5148;&#x8C03;&#x7528;getXxx()&#x7684;&#x65B9;&#x6CD5;&#x3002; </li>
<li>&#x3010;&#x5F3A;&#x5236;&#x3011;&#x540E;&#x53F0;&#x8F93;&#x9001;&#x7ED9;&#x9875;&#x9762;&#x7684;&#x53D8;&#x91CF;&#x5FC5;&#x987B;&#x52A0;$!{var}&#x2014;&#x2014;&#x4E2D;&#x95F4;&#x7684;&#x611F;&#x53F9;&#x53F7;&#x3002; 
<br><span style="color:orange">&#x8BF4;&#x660E;</span>&#xFF1A;&#x5982;&#x679C;var=null&#x6216;&#x8005;&#x4E0D;&#x5B58;&#x5728;&#xFF0C;&#x90A3;&#x4E48;${var}&#x4F1A;&#x76F4;&#x63A5;&#x663E;&#x793A;&#x5728;&#x9875;&#x9762;&#x4E0A;&#x3002; </li>
<li>&#x3010;&#x5F3A;&#x5236;&#x3011;&#x6CE8;&#x610F; Math.random() &#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x8FD4;&#x56DE;&#x662F;double&#x7C7B;&#x578B;&#xFF0C;&#x6CE8;&#x610F;&#x53D6;&#x503C;&#x7684;&#x8303;&#x56F4; 0&#x2264;x&lt;1&#xFF08;&#x80FD;&#x591F;&#x53D6;&#x5230;&#x96F6;&#x503C;&#xFF0C;&#x6CE8;&#x610F;&#x9664;&#x96F6;&#x5F02;&#x5E38;&#xFF09;&#xFF0C;&#x5982;&#x679C;&#x60F3;&#x83B7;&#x53D6;&#x6574;&#x6570;&#x7C7B;&#x578B;&#x7684;&#x968F;&#x673A;&#x6570;&#xFF0C;&#x4E0D;&#x8981;&#x5C06;x&#x653E;&#x5927;10&#x7684;&#x82E5;&#x5E72;&#x500D;&#x7136;&#x540E;&#x53D6;&#x6574;&#xFF0C;&#x76F4;&#x63A5;&#x4F7F;&#x7528;Random&#x5BF9;&#x8C61;&#x7684;<code>nextInt</code>&#x6216;&#x8005;<code>nextLong</code>&#x65B9;&#x6CD5;&#x3002; </li>
<li>&#x3010;&#x5F3A;&#x5236;&#x3011;&#x83B7;&#x53D6;&#x5F53;&#x524D;&#x6BEB;&#x79D2;&#x6570;
<pre class="language-">System.currentTimeMillis();</pre> 
&#x800C;&#x4E0D;&#x662F;
<pre class="language-">new Date().getTime();</pre> 
<span style="color:orange">&#x8BF4;&#x660E;</span>&#xFF1A;&#x5982;&#x679C;&#x60F3;&#x83B7;&#x53D6;&#x66F4;&#x52A0;&#x7CBE;&#x786E;&#x7684;&#x7EB3;&#x79D2;&#x7EA7;&#x65F6;&#x95F4;&#x503C;&#xFF0C;&#x4F7F;&#x7528;<code>System.nanoTime()</code>&#x7684;&#x65B9;&#x5F0F;&#x3002;&#x5728;JDK8&#x4E2D;&#xFF0C;&#x9488;&#x5BF9;&#x7EDF;&#x8BA1;&#x65F6;&#x95F4;&#x7B49;&#x573A;&#x666F;&#xFF0C;&#x63A8;&#x8350;&#x4F7F;&#x7528;<code>Instant</code>&#x7C7B;&#x3002; </li>
<li>&#x3010;&#x63A8;&#x8350;&#x3011;&#x4E0D;&#x8981;&#x5728;&#x89C6;&#x56FE;&#x6A21;&#x677F;&#x4E2D;&#x52A0;&#x5165;&#x4EFB;&#x4F55;&#x590D;&#x6742;&#x7684;&#x903B;&#x8F91;&#x3002; <br><span style="color:orange">&#x8BF4;&#x660E;</span>&#xFF1A;&#x6839;&#x636E;MVC&#x7406;&#x8BBA;&#xFF0C;&#x89C6;&#x56FE;&#x7684;&#x804C;&#x8D23;&#x662F;&#x5C55;&#x793A;&#xFF0C;&#x4E0D;&#x8981;&#x62A2;&#x6A21;&#x578B;&#x548C;&#x63A7;&#x5236;&#x5668;&#x7684;&#x6D3B;&#x3002; </li>
<li>&#x3010;&#x63A8;&#x8350;&#x3011;&#x4EFB;&#x4F55;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x7684;&#x6784;&#x9020;&#x6216;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x90FD;&#x5E94;&#x6307;&#x5B9A;&#x5927;&#x5C0F;&#xFF0C;&#x907F;&#x514D;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x65E0;&#x9650;&#x589E;&#x957F;&#x5403;&#x5149;&#x5185;&#x5B58;&#x3002; </li>
<li>&#x3010;&#x63A8;&#x8350;&#x3011;&#x53CA;&#x65F6;&#x6E05;&#x7406;&#x4E0D;&#x518D;&#x4F7F;&#x7528;&#x7684;&#x4EE3;&#x7801;&#x6BB5;&#x6216;&#x914D;&#x7F6E;&#x4FE1;&#x606F;&#x3002; 
<br><span style="color:orange">&#x8BF4;&#x660E;</span>&#xFF1A;&#x5BF9;&#x4E8E;&#x5783;&#x573E;&#x4EE3;&#x7801;&#x6216;&#x8FC7;&#x65F6;&#x914D;&#x7F6E;&#xFF0C;&#x575A;&#x51B3;&#x6E05;&#x7406;&#x5E72;&#x51C0;&#xFF0C;&#x907F;&#x514D;&#x7A0B;&#x5E8F;&#x8FC7;&#x5EA6;&#x81C3;&#x80BF;&#xFF0C;&#x4EE3;&#x7801;&#x5197;&#x4F59;&#x3002; 
<br><span style="color:green">&#x6B63;&#x4F8B;</span>&#xFF1A;&#x5BF9;&#x4E8E;&#x6682;&#x65F6;&#x88AB;&#x6CE8;&#x91CA;&#x6389;&#xFF0C;&#x540E;&#x7EED;&#x53EF;&#x80FD;&#x6062;&#x590D;&#x4F7F;&#x7528;&#x7684;&#x4EE3;&#x7801;&#x7247;&#x65AD;&#xFF0C;&#x5728;&#x6CE8;&#x91CA;&#x4EE3;&#x7801;&#x4E0A;&#x65B9;&#xFF0C;&#x7EDF;&#x4E00;&#x89C4;&#x5B9A;&#x4F7F;&#x7528;&#x4E09;&#x4E2A;&#x659C;&#x6760;(<code>///</code>)&#x6765;&#x8BF4;&#x660E;&#x6CE8;&#x91CA;&#x6389;&#x4EE3;&#x7801;&#x7684;&#x7406;&#x7531;&#x3002; </li>
</ol>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="日志规约.html" class="navigation navigation-prev " aria-label="Previous page: （二）日志规范">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../单元测试.html" class="navigation navigation-next " aria-label="Next page: 三、单元测试">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"（三）其他","level":"1.3.3","depth":2,"next":{"title":"三、单元测试","level":"1.4","depth":1,"path":"单元测试.md","ref":"单元测试.md","articles":[]},"previous":{"title":"（二）日志规范","level":"1.3.2","depth":2,"path":"异常日志/日志规约.md","ref":"异常日志/日志规约.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["book-summary-scroll-position-saver","github","prism","-sharing","-highlight"],"pluginsConfig":{"github":{"url":"https://github.com/alibaba/p3c"},"book-summary-scroll-position-saver":{},"prism":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css"}},"file":{"path":"异常日志/其他.md","mtime":"2018-01-13T07:52:52.584Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-01-15T14:41:43.583Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-book-summary-scroll-position-saver/book-summary-scroll-position-saver.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

